﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using EzDesk.Apps.Model.ProjectModule;
using EzDesk.Utility.ServiceStatusInfo;

namespace EzDesk.Apps.Interface.ProjectModule
{
    [ServiceContract]
    public interface IProjectService
    {
        #region [ Workitem ]
        [OperationContract]
        StatusInfo<Guid> AddWorkitem(Workitem workItem);

        [OperationContract]
        StatusInfo<Guid> AddFinishedWorkitem(Workitem workItem);

        [OperationContract]
        StatusInfo FinishWorkitem(Guid workitemId, Guid actorId, int points);

        [OperationContract]
        StatusInfo<List<Workitem>> GetWorkitems(
            Guid? ownerId,  // 任务责任人
            Guid? creatorId,  // 任务创建人
            Guid? projectId,  // 所属项目
            bool? isFinished, // 任务是否完成            
            DateTime? startCreateOn, // 创建时间范围开始
            DateTime? endCreateOn, // 创建时间范围结束  
            DateTime? startFinishOn, // 完成时间范围开始
            DateTime? endFinishOn, // 完成时间范围结束
            int? maxCount // 最多条数
            );

        [OperationContract]
        StatusInfo<Workitem> GetWorkitem(Guid workitemId);

        #endregion Workitem


        #region [ DailyWork ]
        [OperationContract]
        StatusInfo<DailyWorks> GetDailyWorks(Guid userId, DateTime day);

        [OperationContract]
        StatusInfo<DailyWorks> UpdateDailyWorks(Guid userId, DateTime day, string content);
        #endregion 

        #region [ Project Info ]

        [OperationContract]
        StatusInfo<Project> CreateNewProject(Project project);

        [OperationContract]
        StatusInfo UpdateDescription(Guid projectId, string description);

        [OperationContract]
        StatusInfo UpdateProjectMember(Guid projectId, string memberString);

        [OperationContract]
        StatusInfo<List<Project>> GetProjectsForUser(Guid userId);

        [OperationContract]
        StatusInfo<Project> GetProjectById(Guid projectId);
        #endregion

        
    }
}
